package org.example.genericreflect;

import java.lang.reflect.Proxy;

class RepositoryProxy {
    public static Repository<?> newProxyInstance(Class<? extends Repository<?>> cls) {
        Object proxyInstance = Proxy.newProxyInstance(cls.getClassLoader(),
                new Class[]{cls},
                new RepositoryAspect());
        return (Repository<?>) proxyInstance;
    }
}
